/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.registration.business.security.entity;

/**
 *
 * @author Stefano
 */
public enum InviteStatus {
    PENDING(0),
    ACCEPTED(1),
    DECLINED(2);
    
    private int id;   
 
    private InviteStatus(int id) {
        this.id = id;
    }
 
    public static InviteStatus getType(Integer id) {
       
        if (id == null) {
            return null;
        }
 
        for (InviteStatus status : InviteStatus.values()) {
            if (id.equals(status.getId())) {
                return status;
            }
        }
        throw new IllegalArgumentException("No matching type for id " + id);
    }
 
    public int getId() {
        return id;
    }
}
